<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		<p:dialog header="Returns Detail" widgetVar="returnsDialog"
			modal="true" showEffect="fade" hideEffect="fade" resizable="false">
			<p:outputPanel id="returnsDetail" style="text-align:center;">
				<p:panelGrid rendered="#{not empty dtPartUnitLazyView.selectedItem}"
					columnClasses="label,value">
					<f:facet name="header">
						<p:row>
							<p:column>Name</p:column>
							<p:column>Brand</p:column>
							<p:column>Unit</p:column>
							<p:column>Part Number</p:column>
						</p:row>
					</f:facet>
					<p:row>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortName}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortBrand}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortUnit}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.part}</p:column>
					</p:row>

				</p:panelGrid>

				<br /><h:message for="quantity"></h:message>
				<p:panelGrid rendered="#{not empty dtPartUnitLazyView.selectedItem}"
					columnClasses="label,value">
					<f:facet name="header">
						<p:row>
							<p:column>Entry Date</p:column>
							<p:column>Source Project</p:column>
							<p:column>Target Warehouse</p:column>
							<p:column>Warehouse Location</p:column>
							<p:column>Quantity</p:column>
							<p:column>Remarks</p:column>
						</p:row>
					</f:facet>
					<p:row>
						<p:column>
							<p:calendar value="#{dtReturnsBalanceLazyView.entryDate}" showOn="button" />
						</p:column>
						<p:column>
							<p:selectOneMenu value="#{dtReturnsBalanceLazyView.projectId}">
								<f:selectItems var="project" value="#{dtReturnsBalanceLazyView.projects}" 
												itemValue="#{project.id}" itemLabel="#{project.code}"/>
							</p:selectOneMenu>
						</p:column>
						<p:column>
							<p:selectOneMenu value="#{dtReturnsBalanceLazyView.warehouseId}">
								<f:selectItems var="warehouse" value="#{dtReturnsBalanceLazyView.warehouses}" 
												itemValue="#{warehouse.id}" itemLabel="#{warehouse.id}"/>
							</p:selectOneMenu>
						</p:column>
						<p:column><p:inputText value="#{dtReturnsBalanceLazyView.location}" /></p:column>
						<p:column>
							<p:inputText id="quantity" value="#{dtReturnsBalanceLazyView.quantity}">
								<f:validateDoubleRange minimum="0.1" maximum="999999999.99" />
							</p:inputText>
							
						</p:column>
						<p:column><p:inputText value="#{dtReturnsBalanceLazyView.remarks}" /></p:column>
					</p:row>
				</p:panelGrid>
				<br/>
				<p:commandButton value="Add"
					ajax="true" update="#{addCommandUpdate}" 
					oncomplete="if(!args.validationFailed) PF('returnsDialog').hide();"  
					action="#{dtReturnsBalanceLazyView.add}" />

			</p:outputPanel>
		</p:dialog>
	</ui:composition>
</body>
</html>